Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Precompile now checks using physical addresses rather than XEIP #60

Merged
merged 4 commits into from
Aug 15, 2024

Conversation

DerelictDrone
Copy link
Member

As the title implies, this switches use of XEIP(CS + IP) out for the Physical Address of the memory, which makes addresses consistent when running with paging enabled and remapping.

This fixes an issue where the CPU would "hallucinate" that it was still capable of running code that, according to the page remapping, shouldn't be there (if you were to try and make a different program run at address 0 by switching page tables, it would think it was running the cpu code at physical address 0 because it was already precompiled and didn't understand the difference between the virtual CS:IP and the physical address)

Added additional checks to try and invalidate an address if a function/precompile straddles a page border and the user tries to execute it after remapping a portion of the function to a different page. Forcing it to precompile again starting at the straddled page border(and the previous section that lead us here if we were to run that again)

Adds a check to trigger interrupt 15(bad address) if you try to execute from a page that's not a whole integer (Check is performed at precompile, error is triggered at execution time)

@DerelictDrone
Copy link
Member Author

I forgot that 0 is truthy in lua for some reason, every other page remap check does Remapped == 1

@DerelictDrone DerelictDrone merged commit e041c35 into wiremod:master Aug 15, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants